/*
Java source file
Copyright: Umschalt.com 2012
*/
package com.david.documentation.domain.dao.doku;

import com.david.documentation.domain.AbstractDokusTest;
import com.david.documentation.domain.dao.tags.TagDao;
import com.david.documentation.domain.entities.doku.Doku;
import com.david.documentation.domain.entities.tags.Tag;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class DokuDaoTest extends AbstractDokusTest{

	@Autowired
	private DokuDao dokuDao;

	@Autowired
	private TagDao tagDao;

	@Test
	public void testDao() throws Exception{
		/*Doku dok = dokuDao.findById(1L);
		System.out.println("TEST: " + dok.getName());
		dok.setName("ein neuer Test");
		dokuDao.merge(dok);
		dok = dokuDao.findById(1L);
		System.out.println("TEST: " + dok.getName());*/
		Tag tag = tagDao.findById(3L);
		System.out.println("TAG: " + tag.getName());
		List<Doku> tags =  dokuDao.findDokusByTag(tag,1,10);

		System.out.println("ASAS: " + tags.size());

	}

}
